package com.structure.adapter;

/**
 * @author xiaobing
 * @version 1.0
 * @date 2021/9/6 5:32 下午
 */
public class AudioPlayer implements MediaPlayer{
    @Override
    public void play(String type, String musicName) {
        if ("mp3".equals(type)){
            System.out.println("播放mp3,音乐："+musicName);
            return;
        }
        if ("VLC".equals(type) || "Mp4".equals(type)){
            MediaAdapter mediaAdapter = new MediaAdapter(type);
            mediaAdapter.play(type,musicName);
            return;
        }
        throw new RuntimeException("播放器不支持此类型！！！");
    }
}
